<template>
  <div class="page">
    <div class="nav_container">
      <mynav></mynav>
    </div>
    <div class="container">
      <div class="search">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="省-市-关键字">
            <el-input v-model="formInline.key" placeholder="省-市-关键字"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
      <BDMap :mapStyle="mapStyle"></BDMap>
    </div>

  </div>
</template>

<script>
  import mynav from "@/components/nav";
  import BDMap from "@/components/baidumap";
  export default {
    components: {
      mynav,
      BDMap
    },
    data() {
      return {
        formInline: {
          key: ''
        },
        mapStyle: {
          width: '100%',
          height: '500px'
        }
      }
    },
    watch: {
      bgColor(val) {
        this.opt.backgroundColor = val ? '#f5f5f5' : "#1f212d";
        this.kChart.setOption(this.opt);
      }
    },
    mounted() {},
    methods: {
      onSubmit() {
        this.$router.push({
          path: '/search',
          query: {
            value: this.formInline.key
          }
        })
      }
    }
  }
</script>
<style lang="less" scoped>
  .page {
    .nav_container {
      background: #382FBA;
      width: 100%;
      height: 74px;
    }

    .search {
      margin: 15px auto;
      text-align: left;
    }
  }
</style>
